<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow: flow::cfg::Dynamic_cfg_context&lt; Root, Target, Target_ptr &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow project: Public API.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceflow.html">flow</a></li><li class="navelem"><a class="el" href="namespaceflow_1_1cfg.html">cfg</a></li><li class="navelem"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html">Dynamic_cfg_context</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classflow_1_1cfg_1_1Dynamic__cfg__context-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">flow::cfg::Dynamic_cfg_context&lt; Root, Target, Target_ptr &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Class which facilitates managing access to a dynamic configuration.  
 <a href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#details">More...</a></p>

<p><code>#include &lt;dynamic_cfg_context.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ab1a92aa896e67105e271dfdc2f34e6f8"><td class="memItemLeft" align="right" valign="top"><a id="ab1a92aa896e67105e271dfdc2f34e6f8" name="ab1a92aa896e67105e271dfdc2f34e6f8"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>Target_ptr_type</b> = Target_ptr</td></tr>
<tr class="memdesc:ab1a92aa896e67105e271dfdc2f34e6f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type alias for <code>Target_ptr</code>. <br /></td></tr>
<tr class="separator:ab1a92aa896e67105e271dfdc2f34e6f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a971da5a0f825e0104f5dd1ff95068fec"><td class="memItemLeft" align="right" valign="top"><a id="a971da5a0f825e0104f5dd1ff95068fec" name="a971da5a0f825e0104f5dd1ff95068fec"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>Get_root_func</b> = Function&lt; typename Root::Const_ptr()&gt;</td></tr>
<tr class="memdesc:a971da5a0f825e0104f5dd1ff95068fec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type for a function object which returns a ref-counted pointer to an immutable root configuration object. <br /></td></tr>
<tr class="separator:a971da5a0f825e0104f5dd1ff95068fec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3196f7977575e45bc21bee7cf38f122"><td class="memItemLeft" align="right" valign="top"><a id="ae3196f7977575e45bc21bee7cf38f122" name="ae3196f7977575e45bc21bee7cf38f122"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>Root_to_target_func</b> = Function&lt; const Target &amp;(const Root &amp;)&gt;</td></tr>
<tr class="memdesc:ae3196f7977575e45bc21bee7cf38f122"><td class="mdescLeft">&#160;</td><td class="mdescRight">Type for a function object which translates a <code>Root</code> object to a contained <code>Target</code> object. <br /></td></tr>
<tr class="separator:ae3196f7977575e45bc21bee7cf38f122"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae0bb63a2cbc720d96e9349440281534e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae0bb63a2cbc720d96e9349440281534e">Dynamic_cfg_context</a> (<a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a971da5a0f825e0104f5dd1ff95068fec">Get_root_func</a> &amp;&amp;get_root_func_moved, <a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae3196f7977575e45bc21bee7cf38f122">Root_to_target_func</a> &amp;&amp;root_to_target_func_moved)</td></tr>
<tr class="memdesc:ae0bb63a2cbc720d96e9349440281534e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae0bb63a2cbc720d96e9349440281534e">More...</a><br /></td></tr>
<tr class="separator:ae0bb63a2cbc720d96e9349440281534e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a41c9e9a2427d273d021062293e99e102"><td class="memTemplParams" colspan="2">template&lt;typename... S_d_value_set&gt; </td></tr>
<tr class="memitem:a41c9e9a2427d273d021062293e99e102"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a41c9e9a2427d273d021062293e99e102">Dynamic_cfg_context</a> (const <a class="el" href="classflow_1_1cfg_1_1Config__manager.html">Config_manager</a>&lt; S_d_value_set... &gt; &amp;config_manager, <a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae3196f7977575e45bc21bee7cf38f122">Root_to_target_func</a> &amp;&amp;root_to_target_func_moved, size_t d_value_set_idx=0)</td></tr>
<tr class="memdesc:a41c9e9a2427d273d021062293e99e102"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a41c9e9a2427d273d021062293e99e102">More...</a><br /></td></tr>
<tr class="separator:a41c9e9a2427d273d021062293e99e102"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6c82e621aac76a1bf954dea71df09cbf"><td class="memItemLeft" align="right" valign="top">Root::Const_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a6c82e621aac76a1bf954dea71df09cbf">root_dynamic_cfg</a> () const</td></tr>
<tr class="memdesc:a6c82e621aac76a1bf954dea71df09cbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtain the root configuration.  <a href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a6c82e621aac76a1bf954dea71df09cbf">More...</a><br /></td></tr>
<tr class="separator:a6c82e621aac76a1bf954dea71df09cbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a64f46bad36bbdb61747bdf47ea5433f8"><td class="memItemLeft" align="right" valign="top">Target_ptr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a64f46bad36bbdb61747bdf47ea5433f8">dynamic_cfg</a> () const</td></tr>
<tr class="memdesc:a64f46bad36bbdb61747bdf47ea5433f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtain the target configuration.  <a href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a64f46bad36bbdb61747bdf47ea5433f8">More...</a><br /></td></tr>
<tr class="separator:a64f46bad36bbdb61747bdf47ea5433f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename Root, typename Target, typename Target_ptr&gt;<br />
class flow::cfg::Dynamic_cfg_context&lt; Root, Target, Target_ptr &gt;</div><p >Class which facilitates managing access to a dynamic configuration. </p>
<p >Another class can make use of this one by means of a composition relationship, either through inheritance (probably <code>private</code> or <code>protected</code>) or by containing one or more <code><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html" title="Class which facilitates managing access to a dynamic configuration.">Dynamic_cfg_context</a></code> members. If using inheritance, the class will gain methods which can be used to access the dynamic configuration. If using composition by members, more than one dynamic configuration can be used, each of which can be accessed separately by calling the access methods of the associated member.</p>
<p >A "configuration," here, is a data object (probably a <code>struct</code>), which is referred to as the "root", containing an internal data object, which is referred to as the "target". The target is the configuration object which is expected to be normally accessed. The root and the target can be the same.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Root</td><td>Type for the root configuration. This should meet the requirements of the template argument for <code><a class="el" href="classflow_1_1cfg_1_1Option__set.html" title="The core config-parsing facility, which builds parsing/comparison/output capabilities on top of a giv...">Option_set</a></code>. A <code>Root::Const_ptr</code> type for a ref-counted pointer to an immutable <code>Root</code> must at least be defined (which can be provided by deriving from <code><a class="el" href="classflow_1_1util_1_1Shared__ptr__alias__holder.html" title="Convenience class template that endows the given subclass T with nested aliases Ptr and Const_ptr ali...">util::Shared_ptr_alias_holder</a></code>). See <a class="el" href="classflow_1_1cfg_1_1Option__set.html" title="The core config-parsing facility, which builds parsing/comparison/output capabilities on top of a giv...">Option_set</a>. </td></tr>
    <tr><td class="paramname">Target</td><td>Type for the target configuration. </td></tr>
    <tr><td class="paramname">Target_ptr</td><td>Please leave this at its default. Background: This would not have been a template parameter in the first place, had the authors known of <code>pointer_traits::rebind</code> at that the time. To preserve backwards compatibility this parameter remains for now (albeit deprecated).</td></tr>
  </table>
  </dd>
</dl>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000009">Todo:</a></b></dt><dd><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html" title="Class which facilitates managing access to a dynamic configuration.">flow::cfg::Dynamic_cfg_context</a> <code>Target_ptr</code> is deprecated and shall be always left at its default value in future code; eventually remove it entirely and hard-code the default value internally. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ae0bb63a2cbc720d96e9349440281534e" name="ae0bb63a2cbc720d96e9349440281534e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0bb63a2cbc720d96e9349440281534e">&#9670;&nbsp;</a></span>Dynamic_cfg_context() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Root , typename Target , typename Target_ptr &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html">flow::cfg::Dynamic_cfg_context</a>&lt; Root, Target, Target_ptr &gt;::Dynamic_cfg_context </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#a971da5a0f825e0104f5dd1ff95068fec">Get_root_func</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>get_root_func_moved</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae3196f7977575e45bc21bee7cf38f122">Root_to_target_func</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>root_to_target_func_moved</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">get_root_func_moved</td><td>Returns a ref-counted pointer to the (immutable) root configuration object. </td></tr>
    <tr><td class="paramname">root_to_target_func_moved</td><td>Translates a root configuration object to a contained target configuration object. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a41c9e9a2427d273d021062293e99e102" name="a41c9e9a2427d273d021062293e99e102"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a41c9e9a2427d273d021062293e99e102">&#9670;&nbsp;</a></span>Dynamic_cfg_context() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Root , typename Target , typename Target_ptr &gt; </div>
<div class="memtemplate">
template&lt;typename... S_d_value_set&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html">flow::cfg::Dynamic_cfg_context</a>&lt; Root, Target, Target_ptr &gt;::Dynamic_cfg_context </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflow_1_1cfg_1_1Config__manager.html">Config_manager</a>&lt; S_d_value_set... &gt; &amp;&#160;</td>
          <td class="paramname"><em>config_manager</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html#ae3196f7977575e45bc21bee7cf38f122">Root_to_target_func</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>root_to_target_func_moved</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>d_value_set_idx</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>
<p >This produces a <code><a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html" title="Class which facilitates managing access to a dynamic configuration.">Dynamic_cfg_context</a></code> which will obtain its configuration from a <code><a class="el" href="classflow_1_1cfg_1_1Config__manager.html" title="Manages a config setup, intended for a single daemon process, by maintaining 1 or more set(s) of stat...">Config_manager</a></code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config_manager</td><td>A <code><a class="el" href="classflow_1_1cfg_1_1Config__manager.html" title="Manages a config setup, intended for a single daemon process, by maintaining 1 or more set(s) of stat...">Config_manager</a></code> which is currently managing the desired dynamic configuration. </td></tr>
    <tr><td class="paramname">root_to_target_func_moved</td><td>Translates a root configuration object to a contained target configuration object. </td></tr>
    <tr><td class="paramname">d_value_set_idx</td><td>The dynamic config slot index of <code>config_manager</code> which corresponds to the desired dynamic configuration. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><code><a class="el" href="classflow_1_1cfg_1_1Config__manager.html" title="Manages a config setup, intended for a single daemon process, by maintaining 1 or more set(s) of stat...">Config_manager</a></code>. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a64f46bad36bbdb61747bdf47ea5433f8" name="a64f46bad36bbdb61747bdf47ea5433f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a64f46bad36bbdb61747bdf47ea5433f8">&#9670;&nbsp;</a></span>dynamic_cfg()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Root , typename Target , typename Target_ptr &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Target_ptr <a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html">flow::cfg::Dynamic_cfg_context</a>&lt; Root, Target, Target_ptr &gt;::dynamic_cfg</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Obtain the target configuration. </p>
<p >This method provides the key mechanism of the class. The returned pointer object can be used to easily access the target object, but will additionally cause the containing root object to be held valid in memory.</p>
<dl class="section return"><dt>Returns</dt><dd>a ref-counted pointer to the (immutable) target configuration object, but which shares ownership of the containing root configuration object. </dd></dl>

</div>
</div>
<a id="a6c82e621aac76a1bf954dea71df09cbf" name="a6c82e621aac76a1bf954dea71df09cbf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6c82e621aac76a1bf954dea71df09cbf">&#9670;&nbsp;</a></span>root_dynamic_cfg()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Root , typename Target , typename Target_ptr &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Root::Const_ptr <a class="el" href="classflow_1_1cfg_1_1Dynamic__cfg__context.html">flow::cfg::Dynamic_cfg_context</a>&lt; Root, Target, Target_ptr &gt;::root_dynamic_cfg</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Obtain the root configuration. </p>
<dl class="section return"><dt>Returns</dt><dd>a ref-counted pointer to the (immutable) root configuration object. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>cfg/<a class="el" href="cfg__fwd_8hpp.html">cfg_fwd.hpp</a></li>
<li>cfg/<a class="el" href="dynamic__cfg__context_8hpp.html">dynamic_cfg_context.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 28 2025 22:55:32 for Flow by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
